package com.xxl.job.executor.sample.frameless.test.singleton;

//工厂方法上加同步
public class LazySingleton2 {
    private LazySingleton2() {}
    private static LazySingleton2 lazySingleton2 = null;
    //静态工厂方法
    public static synchronized LazySingleton2 getInstance() {
        if (lazySingleton2 == null) {
            lazySingleton2 = new LazySingleton2();
        }
        return lazySingleton2;
    }
}
